moneris-logo
Search
×

Moneris Developers_

E-Commerce Solutions
APIarrow_drop_down
Batch Uploadarrow_drop_down
Multi-Currency Pricing (MCP)arrow_drop_down
E-Fraudarrow_drop_down
Hosted Solutionsarrow_drop_down
Level 2/3arrow_drop_down
Apple Payarrow_drop_down
Google Payarrow_drop_down
Visa Checkoutarrow_drop_down
MasterCard MasterPassarrow_drop_down
Card Present Solutions
Pinpadarrow_drop_down
Shopping Cartsarrow_drop_down
×

Configuration

Store ID:
API Token:
Checkout ID:
Amount:
RESET
Moneris Checkout (MCO)
Integration GuideInteractive Tool
.Netkeyboard_arrow_down
Moneris Checkout Overview
Client-Side Checkout Page
Preload Request
Displaying in the Browser
Receipt Request
Terminating Instance
Handling Callbacks
Testing MCO Integration
Production With MCO
GITHUB

Moneris Checkout Overview

Moneris Checkout gives e-commerce merchants a simple and secure way to process payments by integrating a Moneris-hosted payment module into the merchant checkout page.

System and Skills Requirements

In order to integrate with Moneris Checkout as a merchant, you must have:

  • An e-commerce website with a back-end server

For development, you should have some understanding of the following:

  • JavaScript
  • JSON
  • Server-side programming

Additionally, for Google Pay™ integration, all your front-end web pages must use the HTTPS protocol.

Configuration

The first step is to configure your Moneris Checkout page in the Moneris Merchant Resource Center (MRC).

In the initial stage of development, you create a test configuration in the testing MRC.

Once the solution is ready to be deployed to production, you must create a new, separate configuration for the production environment in the production MRC.

The checkout ID is the key value that is generated after the configuration is completed and used within the Preload Request in order to identify the specific Moneris Checkout configuration.

To get the checkout ID and start configuring your page, do the following:

  1. Log into the Merchant Resource Center at one of the following URLs (according to your stage of development)
  2. In the Admin menu, select Moneris Checkout Config
  3. Click the Create Profile button
  4. Follow the on-screen steps to complete the configuration

For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:

https://developer.moneris.com

Moneris Checkout Transaction Process Flow

Additional Features in Moneris Checkout

There are other features of the Moneris Checkout page that you can enable using the configurator in the Merchant Resource Center. They include:

  1. Tokenization of Credentials With Moneris Checkout
  2. Fraud Tools in Moneris Checkout
  3. Window Size in Moneris Checkout
  4. Multi-Currency Pricing in Moneris Checkout

    1. Tokenization of Credentials With Moneris Checkout

    You can configure Moneris Checkout to store a cardholder's credentials in the Moneris Vault and receive a token that represents those credentials for use in future transactions. You can also use Moneris Checkout to update the credentials associated with the token.

    If you want to tokenize credentials in Moneris Checkout transactions, you select the Tokenize Card option in the Merchant Resource Center. For updating existing tokens, select Vault Update Card

    For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:

    https://developer.moneris.com

    Tokens and Pay by Token

    With tokenization enabled, Moneris Checkout also enables you to allow returning customers to select stored payment cards on the payment page. The customer's payment cards need to be already tokenized and stored in the Moneris Vault to be referenced in the Preload request and displayed to the customer when they get to the payment page.

    In the Preload request, Moneris Checkout will accept a token composed of up to three pairs of data key and issuer ID, each one representing the cardholder's payment card stored in the Moneris Vault.

    For more information about these fields in the Preload, see Preload Request

    2. Fraud Tools in Moneris Checkout

    Several tools to mitigate the risk of fraud are available for transactions in Moneris Checkout, including:

    • AVS
    • CVD
    • 3-DSecure
    • Kount

    To select which of these tools to use when performing transactions with Moneris Checkout, go to your Moneris Checkout configurator in the Moneris Merchant Resource Center under the Payment Security section.
    For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:

    https://developer.moneris.com

    If you select Kount as a fraud tool in Moneris Checkout and your company has its own Enterprise service account from Kount, you will need to include your Kount Merchant ID, Kount API Key and Kount Web- site ID when you configure your Moneris Checkoutstore in the Merchant Resource Center.
    If you are using Moneris's basic fraud service package and do not have your own Kount enterprise account, you do not require this information.

    Moneris Checkout can be configured to automatically proceed with or deny transactions as a result of a risk assessment it makes based on the responses it receives from the selected fraud tools.
    When you check the box for auto decision-making, you also can choose whether each fraud tool's ana- lysis will be treated by Moneris as an optional or mandatory factor in the decision to approve or deny the transaction.
    This information applies to all fraud tools with the following exception:

    • 3-D Secure, which is always mandatory if enabled

    3. Window Size in Moneris Checkout

    You can customize the appearance of the Moneris Checkout window presented to the customer on their web browser, including how much of the browser window will be taken up by Moneris Checkout.
    The default sizing behaviour of the Moneris Checkout window is full-screen, i.e., Moneris Checkout fills the entire web page. You can alter this behaviour to present the customer with a windowed view instead.
    If you do not use the full-screen option, you must define the size of the <div> for the window ed view. For more information, see 2.3 Preparing Your Client-Side Checkout Page.
    You configure the sizing along with other aspects of the Moneris Checkout window in the Merchant Resource Center.

    4. Multi-Currency Pricing in Moneris Checkout

    You can configure Moneris Checkout to price goods and services in a variety of foreign currencies, while continuing to receive settlement and reporting in Canadian dollars.
    If you want to use Multi-Currency Pricing (MCP) in Moneris Checkout transactions, you can enable the Multi-Currency Pricing option in the Merchant Resource Center. MCP is only available for Visa and Mastercard.
    If Multi-Currency Pricing is enabled, the following features are not supported:

    • Recurring Billing
    • Gift Cards
    • 3-DSecure 1.0
    • Google PayTM

    For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:

    https://developer.moneris.com

Client-Side Checkout Page

In order to prepare your client-side checkout page for interacting with Moneris Checkout, you need to do a few tasks first:

  1. Add a call to the Moneris Checkout JavaScript library in a <script> tag:
    Test
    <script src="https://gatewayt.moneris.com/chktv2/js/chkt_v2.00.js">
    Production
    <script src="https://gateway.moneris.com/chktv2/js/chkt_v2.00.js">
  2. Create a <div> in the HTML:
    <div id="monerisCheckout"></div>
    (Optional): If you are not using the "Full screen" window sizing option, you will need to define the size of your window by creating another <div> around this one, for example:
    <div id="outerDiv" style="width:400px"; height"300px"> <div id="monerisCheckout"></div></div>
  3. Instantiate the monerisCheckout object and set it up:
    var myCheckout = new monerisCheckout();
    myCheckout.setMode("qa");
    myCheckout.setCheckoutDiv("monerisCheckout");
  4. Set callbacks in JavaScript:
    var myCheckout = new monerisCheckout();
    myCheckout.setCallback("page_loaded", myPageLoad);
    myCheckout.setCallback("cancel_transaction", myCancelTransaction);
    myCheckout.setCallback("error_event", myErrorEvent);
    myCheckout.setCallback("payment_receipt", myPaymentReceipt);
    myCheckout.setCallback("payment_complete", myPaymentComplete);

Preload Request

The Preload request is the means by which a Moneris Checkout instance is securely generated at transaction time. It involves a server-to-server post using the JSON format.

The response to the Preload request returns a ticket number which uniquely identifies the instance and must be passed in the JavaScript

myCheckout.startCheckout(ticket#);

request in order to display the Moneris Checkout page in the browser.

In your server implementation, use the following Moneris Checkout URLs to post to, depending on the development stage:

Testing:

https://gatewayt.moneris.com/chktv2/request/request.php

Production:

https://gateway.moneris.com/chktv2/request/request.php

Transaction requests are sent to the Moneris Checkout server using JSON.

JSON structure overview for Preload request

EXAMPLE PRELOAD REQUEST JSON

NOTE: This example reflects a Preload request with all optional objects; the code is for illustrative purposes only and is not executable.

{
    "store_id":"moneris",
    "api_token":"hurgle",
    "checkout_id":"chkt5BF66neris",
    "txn_total":"452.00",
    "environment":"qa",
    "action":"preload",
    "token": [
    {
        "data_key": "abc123datakey1",
        "issuer_id": "645sddfvdrt4tefd"
    },
    {
        "data_key": "abc123datakey2",
        "issuer_id": "645sddfvdrt4tefd"
    },
    {
        "data_key": "abc123datakey3",
        "issuer_id": "645sddfvdrt4tefd"
    }
    ],
    "ask_cvv":"Y"
    "order_no":"",
    "cust_id":"chkt - cust - 0303",
    "dynamic_descriptor":"dyndesc",
    "language":"en",
    "shipping_amount":"200.00",
    "recur":{
        "bill_now":"true",
        "recur_amount":"1.00",
        "start_date":"2021-11-21",
        "recur_unit":"month",
        "recur_period":"1",
        "number_of_recurs":"10"
    },
    "cart":{
        "items":[
            {
                "url":"https:\/\/example.com\/examples\/item1.jpg",
                "description":"One item",
                "product_code":"one_item",
                "unit_cost":"100.00",
                "quantity":"1"
            },
            {
                "url":"https:\/\/example.com\/examples\/item2.jpg",
                "description":"Two item",
                "product_code":"two_item",
                "unit_cost":"200.00",
                "quantity":"1"
            },
            {
                "url":"https:\/\/example.com\/examples\/item3.jpg",
                "description":"Three item",
                "product_code":"three_item",
                "unit_cost":"100.00",
                "quantity":"1"
            }
        ],
        "subtotal":"400.00",
            "tax":{
            "amount":"52.00",
            "description":"Taxes",
            "rate":"13.00"
        }
    },
    "contact_details":{
        "first_name":"bill",
        "last_name":"smith",
        "email":"test@moneris.com",
        "phone":"4165551234"
    },
    "shipping_details":{
        "address_1":"1 main st",
        "address_2":"Unit 2012",
        "city":"Toronto",
        "province":"ON",
        "country":"CA",
        "postal_code":"M1M1M1"
    },
    "billing_details":{
        "address_1":"1 main st",
        "address_2":"Unit 2000",
        "city":"Toronto",
        "province":"ON",
        "country":"CA",
        "postal_code":"M1M1M1"
    }
}

Request fields for Preload request – Required

Variable NameType and limitsDescription
store ID
store_id
String

10-character alphanumeric
Unique identifier provided by Moneris upon merchant account set up
API token
api_token
String

20-character alphanumeric
Unique alphanumeric string assigned upon merchant account activation
checkout ID
checkout_id
String

30-character alphanumeric (maximum)
Identifies your Moneris Checkout configuration; this is given to you when you configure your page in the Merchant Resource Center
transaction amount
txn_total
String

10-character decimal
Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point
The total dollar amount of the transaction
developmental mode
environment
String

alphabetic
qa or prod
Indicates the stage of development you are sending the request for:

testing = qa
production = prod
request type
action
String

alphabetic
Type of request being made to Moneris Checkout server. Allowable values:
preload or receipt

Request fields for Preload request – Optional

Variable NameType and limitsDescription
order number
order_no
String

50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
The order number is a unique identified appended to every financial transaction
customer ID
cust_id
String

50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Merchant defined field that can be used as an identifier
Searchable from the Moneris Merchant Resource Center
dynamic descriptor
dynamic_descriptor
String

20-character alphanumeric
< > $ % = \? ^ { } [ ] "
total of 22 characters including your merchant name and separator
Merchant-defined description sent on a per-transaction basis that will appear on the credit card statement appen- ded to the merchant’s business name. Dependent on the card issuer, the statement will typically show the dynamic descriptor appended to the merchant's existing business name separated by the "/" character; addi- tional characters will be truncated. NOTE: The 22-character maximum limit must take the "/" into account as one of the characters
language
language
String

2-character alphabetic
Determines which language Moneris Checkout will display information in
Allowable values:
en – English
fr – French
data key
data_key
String

25-character alphanumeric
Unique identifier for a Vault profile, and used in future Vault financial transactions to associate a transaction with that profile

Data key is generated by Moneris and returned to you in the Receipt object when the profile is first registered.
prompt for CVV
ask_cvv
String

1-character alphabetic

Y or N
When set to Y, Moneris Checkout will prompt the cardholder to enter their CVV when they select a payment card that has been stored as a token
shipping amount
shipping_amount
String

10-character decimal
Shipping cost of the items to be shipped.

Optional Objects for Preload Requests in Moneris Checkout

Moneris Checkout also allows you to send optional objects in the Preload request that reflect additional information entered by the customer at checkout, enable additional features, or meet transaction pro- cessing requirements.

If you have configured Moneris Checkout to handle these additional items, you do not send the cor- responding object in the Preload request. Only send these optional objects if you are using your own e- commerce page to collect them separately from Moneris Checkout.

Variable NameType and limitsDescription
Recurring Billing
recur
Object

N/A
Contains fields related to Recurring Billing
Shopping Cart
cart
Object

N/A
The virtual shopping cart and its contents
Contact Details
contact_details
Object

N/A
Customer contact information
This object is returned in the Response to Receipt Request as the Customer Information response object (cust_info)
Shipping Details
shipping_details
Object

N/A
Customer shipping information
Billing Details
billing_details
Object

N/A
Customer billing information
token
token
Array Object

N/A
Array object containing between 1 to 3 pairs of a unique data key and an associated issuer ID, each pair representing an instance of a payment card stored in the Moneris Vault Moneris Checkout will accept a maximum three token pairs of data key and issuer ID for each customer

Preload Request with Recurring Billing - Optional object

Include this object in Preload request to indicate the start of a series of Recurring Billing transactions that will be managed by Moneris.

Top level object field:

recur
Variable NameType and limitsDescription
number of recurs
number_of_recurs
String
numeric
1-999
The number of times that the transaction must recur
period
recur_period
String
numeric
1-999
Number of recur unit intervals that must pass between recurring billings
recurring amount
recur_amount
String
10-character decimal, minimum three digits
Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point
EXAMPLE: 1234567.89
Dollar amount of the recurring transaction. This amount will be billed on the start date, and then billed repeatedly based on the interval defined by period and recur unit.
recur unit
recur_unit
String
day, week, month or eom
Unit to be used as a basis for the interval. Works in conjunction with the period variable to define the billing frequency.
start date
start_date
String
YYYY/MM/DD format
Date of the first future recurring billing transaction; this must be a date in the future. If an additional charge will be made immediately, the start now variable must be set to true.
bill now
bill_now
String
true or false
Set to true if a charge will be made against the card immediately; otherwise set to false.

Preload Request with Shopping Cart - Optional object

The shopping cart object can contain multiple items (each item is represented as its own array within the Shopping Cart object).

Top level field

cart

Required Variables for Shopping Cart

Variable NameType and limitsDescription
shopping cart items
items
Object
sub-object containing arrays, nested within cart
contains following items in blue
Encapsulates the entire array of items in the shopping cart
URL
items.url
String
alphanumeric
URL that corresponds to the image Moneris Checkout shopping cart item
description
items.description
String
200-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Describes the item in the shopping cart
product code
items.product_code
String
50-character decimal
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
The SKU for the item
unit cost
items.unit_cost
String
10-character decimal
Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point
EXAMPLE: 1234567.89
Per-unit cost of the item
quantity
items.quantity
String
numeric
6 characters maximum
Number of individual instances of the given item in the shopping cart
subtotal
subtotal
String
10-character decimal
Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point
EXAMPLE: 1234567.89
Total dollar amount of the shopping cart, before taxes
tax
tax
Object
sub-object nested within cart
contains following items in blue
Contains information related to taxes charged on the items in the shopping cart.
tax amount
tax.amount
String
10-character decimal
Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point
EXAMPLE: 1234567.89
Dollar amount of taxes
tax description
tax.description
String
50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Describes type of tax being applied
tax rate
tax.rate
String
Must be a numer wth up to 3 decimal places
EXAMPLE: xx or xx.x or xx.xx or xx.xxx
Percentage tax rate charged

Preload Request with Contact Details - Optional object

Top Level Field

contact_details

Required Variables for Contact Details Object

Variable NameType and limitsDescription
first name
first_name
String
30-character alphanumeric
Customer first name
last name
last_name
String
30-character alphanumeric
Customer last name
e-mail
email
String
255-character alphanumeric
Customer email
phone number
phone
String
30-character alphanumeric
Customer phone number

Preload Request with Shipping Details - Optional object

Top Level Field

shipping_details

Required Variables for Shipping Details Object

Variable NameType and limitsDescription
shipping address line 1
address_1
String

50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Customer shipping address
shipping address line 2
address_2
String
50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Customer shipping address
shipping city
city
String
50-character alphanumeric
Customer shipping address city
shipping province
province
String
2-character alphanumeric
Customer shipping address province. Country subdivision ISO 3166-2
shipping country
country
String
2-character alphanumeric
Customer shipping address country
ISO 3166-1 alpha-2
shipping postal code
postal code
String
20-character alphanumeric

NOTE: some special characters are not allowed
< > $ % = \? ^ { } [ ] "

Customer shipping address postal code

Billing Details Object

Optional object

NOTE: Billing-related fields are required when sending 3-D Secure authentication transactions, or else the authentication process may fail.

Top Level Field

billing_details

Required Variables for Billing Details Object

Variable NameType and limitsDescription
billing address line 1
address_1
String
50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Customer billing address
billing address line 2
address_2
String
50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Customer shipping address
billing city
city
String
50-character alphanumeric
Note: some special characters are not allowed
< > $ % = \? ^ { } [ ] "
Customer billing address city
billing province
province
String
3-character alphanumeric
Customer billing address province. Country subdivision ISO 3166-2
billing country
country
String
2-character alphanumeric
Customer billing address country
ISO 3166-1 alpha-2
billing postal code
postal code
String
20-character alphanumeric
Customer billing address postal code

Response to Preload Request

//Successful Preload:

{
    "response":{
       "success":"”true”",
       "ticket":"1585G9G9GIKKGGGIGIOG09G9OGKGJFKFJFNjuit8g9"
    }
}

//Failed Preload
{
    "response":{
       "success":"”false”",
       "error":{
          "billing_details":{
             "data":"”billing address must be set when AVS is enabled”"
          }
       }
    }
}

Response Fields – Response to Preload Request

Variable NameTypeDescription
response "response":
String
N/A
Top level response object
success "success":
boolean
N/A
Denotes whether the Preload request was successful
ticket "ticket":
String
Identifies the specific Moneris Checkout instance
Only returned if success = true
error "error":
StringSub-object that encapsulates all errors that occurred as a result of the Preload request
Only returned if success = false
data "data":
String
Describes the specific type of error that occurred as a result of some aspect of the Preload request

Display in Browser

When a customer goes to check out their items for purchase, the Moneris Checkout page is displayed in the <div> tag you created on your web site.

To insert the Moneris Checkout instance into the <div>, you call the JavaScript function:

myCheckout.startCheckout("");

Receipt Request

Once the Payment Complete callback has been called, your merchant website can make the server-to-server Receipt Request call in order to obtain the details of the transaction for the receipt and to determine whether the transaction was approved or declined.

In your server implementation, use the following Moneris Checkout URLs to post to, depending on the development stage:

Testing:

https://gatewayt.moneris.com/chktv2/request/request.php

Production:

https://gateway.moneris.com/chktv2/request/request.php

EXAMPLE RECEIPT REQUEST JSON

{
  "store_id": "example_storeId",
  "api_token": "example_apiToken",
  "checkout_id": "example_checkoutId",
  "ticket": "1539966660vfTyEASfnwNrsQqFE8VkMAOcN169zt",
  "environment": "qa",
  "action": "receipt"
}

Once the transaction is finished, you can request the receipt details from the Moneris Checkout server.

Request fields for Receipt Request – Required

Variable NameType and limitsDescription
store ID
store_id
String
N/A
Unique identifier provided by Moneris upon merchant account set up
API token
api_token
String
N/A
Unique alphanumeric string assigned upon merchant account activation
checkout ID
checkout_id
String
30-character alphanumeric (maximum)
Identifies your Moneris Checkout configuration; this is given to you when you configure your page in the Merchant Resource Center
ticket number
ticket
String
maximum 50-character alphanumeric
The unique ticket number that identifies a particular transaction; this returned in the response to the Preload request
developmental mode
environment
String
alphabetic
Indicates the stage of development you are sending the request for:

testing = qa
production = prod
request type
action
String
alphabetic
Type of request being made to Moneris Checkout server. Allowable values:

preload or receipt

Response to Receipt Request

Responses to Receipt Requests can contain multiple, nested response objects.

JSON structure overview for Preload request

Definition of Response Fields – Response to Receipt Request

The following are fields that may be returned in the Response to Receipt Request, shown with nesting

Variable NameDescription
response
{"response":{
Top level response object
success
"success":
Denotes whether request was successful (i.e., approved, declined)
Unsuccessful means error or could not process
Possible values: true or false
keyboard_arrow_downrequest
"request":{
Contains information relating to the Preload request and other information that Moneris Checkout sends to the Moneris Gateway when processing the financial transaction
keyboard_arrow_downReceipt
"receipt":{
Object containing the receipt information

Example JSON Response to Receipt Request

NOTE: Not all features in Moneris Checkout are supported simultaneously, and therefore some objects would not actually appear in the response at the same time in a real-world scenario; response code below is provided for illustrative purposes only.

{
    "response":{
        "success":"true",
        "request":{
            "txn_total":"6.00",
            "cust_info":{
                "first_name":"bill",
                "last_name":"smith",
                "phone":"4165551234",
                "email":"test@moneris.com"
            },
            "shipping":{
                "address_1":"1 main st",
                "address_2":"Unit 2012",
                "city":"Toronto",
                "country":"Ca",
                "province":"On",
                "postal_code":"M1M1M1"
            },
            "billing":{
                "address_1":"1 main st",
                "address_2":"Unit 2000",
                "city":"Toronto",
                "province":"ON",
                "country":"CA",
                "postal_code":"M1M1M1"
            },
            "recur":{
                "number_of_recurs":"3",
                "recur_period":"1",
                "recur_amount":"15.00",
                "recur_unit":"month",
                "start_date":"20220902",
                "bill_now":"false"
            },
            "cart":{
                "items":[
                    {
                        "url":"https:\/\/esqa.moneris.com\/cr\/checkout\/item3.jpg",
                        "description":"Three item",
                        "product_code":"two_item",
                        "unit_cost":"11.00",
                        "quantity":"1"
                    }
                ],
                "subtotal":"10.24",
                "tax":{
                    "amount":"0.00",
                    "description":"Tax",
                    "rate":"0"
                }
            },
            "cc_total":"6.00",
            "cc":{
                "first6last4":"4242424242",
                "expiry":"1221",
                "cardholder":"test",
            },
            "mcp":{
                "merchant_settlement_amount":"452.00",
                "cardholder_currency_code":"978"
            },
            "gift":[
                {
                    "balance_remaining":"0.00",
                    "Description":"Gift Fixed Reload",
                    "first4last4":"************0214",
                    "pan":"0211020000001000214",
                    "cvd":"123",
                    "balance_used":"200.00"
                }
            ],
            "wallet":{
                "type":"applepay",
                "paymentData":{
                    "token":{
                        "paymentData":{
                            "data":"0YJMuivQ6+xILNQyDfwO+kzKWZ//TkNa5nxBzHIf7fw==",
                            "signature":"MIAGCSqGSIb3DJ7mrwhISSB+Ic6kAAAAAAAA=",
                        "header":{
                            "publicKeyHash":"18hkrHSrxIdbZs5qKY4US8bFqEk6bBGXde14yQrwrd8=",
                            "ephemeralPublicKey":"MFkwEwYHKoZIzj0h6ilzF+Z4dseqHDjsdYA==",
                            "transactionId":"4c0d6ae158aa0322b1f5baf6467195e0238ca48f"
                        },
                        "version":"EC_v1"
                        },
                "paymentMethod":{
                    "displayName":"Discover 2780",
                    "network":"Discover",
                    "type":"credit"
                },
                "transactionIdentifier":"4C0D6AE158AA03CC4BAF6467195E0238CA48F"
            }
        }
    },
    "ticket":"1635780027iwm4IczLlO2LqHQ6xHmvDJ1xFIS2vT",
    "cust_id":"chkt- cust -1101",
    "dynamic_descriptor":"dyndesc",
    "order_no":"20211101152026",
    "eci":"7"
},
"receipt":{
    "result":"a",
    "gift":[
        {
            "order_no":"1583250405Ad1BmCSsfHHDeu4_g1",
            "transaction_no":"6198-1583250435590-00157838_15",
            "reference_no":"3276071",
            "response_code":"000",
            "benefit_amount":"200.00",
            "benefit_remaining":"0.00",
            "first6last4":"0211020214"
        }
    ],
    "cc":{
        "order_no":"20211101152026",
        "cust_id":"chkt- cust -1101",
        "transaction_no":"8291-0_20",
        "reference_no":"660115340017373030",
        "transaction_code":"00",
        "transaction_type":"200",
        "transaction_date_time":"2021-11-01 11:20:53",
        "corporate_card":null,
        "amount":"6.00",
        "response_code":"027",
        "iso_response_code":"01",
        "approval_code":"489642",
        "card_type":"V",
        "dynamic_descriptor":"dyndesc",
        "invoice_number":null,
        "customer_code":null,
        "eci":"7",
        "cvd_result_code":"1M",
        "avs_result_code":"null",
        "cavv_result_code":null,
        "first6last4":"4242424242",
        "expiry_date":"1221",
        "recur_success":"null",
        "issuer_id":null,
        "is_debit":null,
        "advice_code":"40",
        "ecr_no":"66011534",
        "batch_no":"737",
        "sequence_no":"303",
        "result":"a",
        "cf_success":"true",
        "cf_fee_amt":"0.11",
        "cf_fee_rate":"1.75",
        "cf_fee_type":"PCT",
        "cf_status":"2",
        "tokenize":{
            "success":"true",
            "first4last4":"2222***0011",
            "datakey":"4sbe08wFMEePj4632EVIbWNL2",
            "status":"001",
            "message":"Successfully updated CC details."
        },
        "mcp":{
            "merchant_settlement_amount":"452.00",
            "cardholder_currency_code":"978",
            "mcp_rate":"1.508",
            "decimal_precision":"2",
            "cardholder_amount":"299.73",
            "cardholder_currency_desc":"EUR"
        },
        "fraud":{
            "3d_secure":{
                "decision_origin":"Merchant",
                "result":"3",
                "condition":"1",
                "status":"disabled",
                "code":"",
                "details":""
            },
            "kount":{
                "decision_origin":"Merchant",
                "result":"3",
                "condition":null,
                "status":"disabled",
                "code":"",
                "details":""
            },
            "avs":{
                "decision_origin":"Merchant",
                "result":"3",
                "condition":"0",
                "status":"disabled",
                "code":"",
                "details":""
            },
            "cvd":{
                "decision_origin":"Merchant",
                "result":"1",
                "condition":"0",
                "status":"success",
                "code":"1M",
                "details":""
            }
        },
        "vault_data":[
            {
                "data_key":"JNDSFQKD8iRsCQM5TcBObz9V7",
                "is_valid":"true"
            },
            {
                "data_key":"4jZb8X1gCpWfC4f4KKh6Fizf2",
                "is_valid":"true"
            },
            {
                "data_key":"jjq6xx5cUQsS1AhwaQhNYpKG8",
                "is_valid":"true"
            }
        ]
      }
    }
  }
}

Terminate Instance

To terminate the Moneris Checkout instance, call myCheckout.closeCheckout(), for example:

myCheckout.closeCheckout(" ");

Handling Callbacks

Callbacks are the means by which Moneris Checkout communicates with your merchant checkout page. All callbacks include a single parameter defined as a JSON-formatted string.

In order to handle callbacks, you need to create JavaScript functions that receive the callbacks being sent by Moneris Checkout when the events occur. These functions are linked to the callbacks you set earlier when you prepared your site's checkout page, as described in the Client-Side Checkout Page section.

Callbacks Types

These callbacks are required to be included in the JavaScript of your page:

  1. Page Loaded
  2. Cancel Transaction
  3. Error Event
  4. Payment Receipt
  5. Payment Complete
  6. Page Closed
  7. Payment Submitted

Callback Response Fields

Variable NameType and limitsDescription
handler
handler
String
alphanumeric
Describes the type of callback being used.

Possible values:
cancel_transaction
error_event
page_loaded
payment_complete
payment_receipt
ticket
ticket
String
alphanumeric
Identifies the specific Moneris Checkout instance
This is also returned in the response to the original Preload
response code
response_code
String
alphanumeric
Identifies the result of the callback.
For information on response codes, see Callback Response Codes – Moneris Checkout

Here are examples of different callbacks

  1. Page Loaded:

    To get the page loaded status of the Moneris Checkout page.
    This callback is called once the Moneris Checkout is loaded.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("page_loaded",myPageLoad);

    JSON Response Message Format:

    {
      "handler": "page_loaded",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }
  2. Cancel Transaction:

    This callback is called in the event the cardholder presses the cancel button in Moneris Checkout.
    Standard is to call the closeCheckout() method to close the Moneris Checkout <div>.
    The closeCheckout( ) method will need to be called and a new Preload request will be required in order to initiate a new Moneris Checkout instance.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("cancel_transaction",myCancelTransaction);

    JSON Response Message Format:

    {
      "handler": "cancel_transaction",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }
  3. Error Event:

    When an error occurs during the checkout process. This requires the Moneris Checkout session to be closed using the closeCheckout function
    To attempt the transaction again, a new Preload request must be sent to the Moneris Checkout server in order to get a new transaction ticket number.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("error_event",myErrorEvent);

    JSON Response Message Format:

    {
      "handler": "error_event",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "902"
    }
  4. Payment Receipt:

    Transaction is complete and receipt is ready to be collected.
    If you have chosen to have Moneris Checkout generate the receipt, this callback is called once the Mon- eris Checkout displays the transaction receipt.
    If you have chosen Moneris Checkout not to generate a receipt, this callback will not be called. For information on when to obtain the receipt response for the transaction, refer to the Payment Complete callback.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("payment_receipt",myPaymentReceipt);

    JSON Response Message Format:

    {
      "handler": "payment_receipt",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }
  5. Payment Complete:

    This callback is called once Moneris Checkout has completed payment.
    If you have chosen Moneris Checkout to generate a receipt, the cardholder has to return to your Checkout page in order for the callback to be called.
    For information on obtaining the receipt response for the transaction, refer to the Payment Receipt callback .
    Moneris Checkout should be closed by calling the closeCheckout() method

    JavaScript Set Method for Callback:

    myCheckout.setCallback("payment_complete",myPaymentComplete);

    JSON Response Message Format:

    {
      "handler": "payment_complete",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }
  6. Page Closed:

    This callback is called when user is on payment page and try to

    1. Close window
    2. Click on Browser Back Button
    3. JavaScript error occurred from Moneris Script

    Moneris Checkout should be closed by calling the closeCheckout() method We will continue with the payment. No changes to the payment flow.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("page_closed",myPageClosed);

    JSON Response Message Format:

    When User close window, Browser back button or Reload Button.

    {
      "handler": "page_closed",
      "response_code": "001"
    }

    When Javascript Error Occur

    {
      "handler": "page_closed",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }
  7. Payment Submitted:

    This callback is called will be triggered when cardholder clicks Checkout button and payment processing is started.

    JavaScript Set Method for Callback:

    myCheckout.setCallback("payment_submitted",myPaymentSubmitted);

    JSON Response Message Format:

    {
      "handler": "payment_submitted",
      "ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
      "response_code": "001"
    }

Callback Response Codes

RESPONSE CODEREASON
001Success
9023-D Secure failed on response
2001Invalid ticket
2002Ticket re-use
2003Ticket expired

Testing Your Moneris Checkout Integration

In the testing stage of development:

  1. Use the testing Merchant Resource Center at https://esqa.moneris.com/mpg to configure your Moneris Checkout page for testing purposes.

  2. Use the testing URL for server to server requests:
    https://gatewayt.moneris.com/chktv2/request/request.php

  3. Use the testing JavaScript library:
    <script src="https://gatewayt.moneris.com/chktv2/js/chkt_v2.00.js"></script>
  4. Set up your myCheckout object to the testing mode:
    myCheckout.setMode("qa");
  5. In all Preload requests use the value "qa" for the environment variable.

  6. In all Preload requests, make sure that you are using the testing version of your credentials for Store ID, API token and Checkout ID.

  7. In all Receipt requests use the value "qa" for the environment variable.

  8. In all Receipt requests, make sure that you are using the testing version of your credentials for Store ID, API token and Checkout ID.

Test Cards for Moneris Checkout

Test card numbers are available for testing your Moneris Checkout integration. For the most current test
card information, see the Moneris developer portal at:

https://developer.moneris.com/en/More/Testing/Testing%20a%20Solution

Special information for testing convenience fee/service fee:

For testing transactions with convenience fee/service fee in Moneris Checkout, you must use the specific test credentials:

Store ID: monca00392

Username: DemoUser

Password: password

Moving to Production with MCO

Once you have finished testing your Moneris Checkout integration, do the following to move the integration into production:

  1. Ensure that you have duplicated your final testing configuration in your Moneris Checkout production configuration in the production Merchant Resource Center at https://www3.moneris.com/mpg

  2. Use the production URL for server to server requests:
    https://gateway.moneris.com/chktv2/request/request.php

  3. Use the production JavaScript library:
    <script src="https://gateway.moneris.com/chktv2/js/chkt_v2.00.js"></script>
  4. Set up your myCheckout object to the production mode:
    myCheckout.setMode("prod");
  5. In all Preload requests use the value "prod" for the environment variable.

  6. In all Preload requests, make sure that you are using the production version of your credentials for Store ID, API token and Checkout ID.

  7. In all Receipt requests use the value "prod" for the environment variable.

  8. In all Receipt requests, make sure that you are using the production version of your credentials for Store ID, API token and Checkout ID.

Copyright © 2021 Moneris Solutions Corporation, All Rights Reserved

®MONERIS and MONERIS & Design are registered trade-marks of Moneris Solutions Corporation. VISA is a registered trade-mark of Visa International. MASTERCARD and MASTERCARD SECURECODE are registered trade-marks of MasterCard International Incorporated. DISCOVER is a registered trade-mark of Discover Financial Services. AMERICAN EXPRESS and AMERICAN EXPRESS SAFEKEY are registered trade-marks of American Express Company. INTERAC is a registered trade-mark of Interac Inc. Apple, the Apple logo, Apple Pay and iPhone are trademarks of Apple Inc., registered in the U.S. and other countries.

â„¢MONERIS BE PAYMENT READY & Design is a trade-mark of Moneris Solutions Corporation. ANDROID is a trademark of Google Inc. MASTERPASS is a trade-mark of MasterCard International Inc.

All other marks or registered trade-marks are the property of their respective owners.